From: Brion Vibber Date: Wed, 13 Oct 2004 07:38:43 +0000 (+0000) Subject: Pull the actual series of updater calls into do_all_updaters(), add X-Git-Tag: 1.5.0alpha1~1568 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=3aa17a75a33c6dd35f8b45af7cb9a5ff6b002879;p=lhc%2Fweb%2Fwiklou.git Pull the actual series of updater calls into do_all_updaters(), add the necessary require_all's to updaters.inc, and add a command-line update.php which runs them without having to pull things out and run the web installer. --- diff --git a/config/index.php b/config/index.php index 920edc712e..b073069155 100644 --- a/config/index.php +++ b/config/index.php @@ -482,36 +482,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { print "
\n";
 			chdir( ".." );
 			flush();
-
-
-			# Add missing tables
-			foreach ( $wgNewTables as $tableRecord ) {
-				add_table( $tableRecord[0], $tableRecord[1] );
-				flush();
-			}
-
-			# Add missing fields
-			foreach ( $wgNewFields as $fieldRecord ) {
-				add_table( $fieldRecord[0], $fieldRecord[1], $fieldRecord[2] );
-				flush();
-			}
-
-			# Do schema updates which require special handling
-			do_interwiki_update(); flush();
-			do_index_update(); flush();
-			do_linkscc_1_3_update(); flush();
-			convertLinks(); flush();
-			do_image_name_unique_update(); flush();
-
-			if ( isTemplateInitialised() ) {
-				print "Template namespace already initialised\n";
-			} else {
-				moveCustomMessages( 1 ); flush();
-				moveCustomMessages( 2 ); flush();
-				moveCustomMessages( 3 ); flush();
-			}
-
-			initialiseMessages(); flush();
+			do_all_updates();
 			chdir( "config" );
 
 			print "
\n"; @@ -655,7 +626,7 @@ if( count( $errs ) ) { $name ) { - $sel = ($code == $conf->LanguageCode) ? "selected" : ""; + $sel = ($code == $conf->LanguageCode) ? 'selected="selected"' : ''; echo "\t\t\n"; } ?> diff --git a/maintenance/update.php b/maintenance/update.php new file mode 100644 index 0000000000..955be7ddc6 --- /dev/null +++ b/maintenance/update.php @@ -0,0 +1,20 @@ + diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index da96ef1213..3a2c6b8f83 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -6,6 +6,10 @@ /** */ +require_once 'convertLinks.inc'; +require_once 'InitialiseMessages.inc'; +require_once 'archives/moveCustomMessages.inc'; + $wgNewTables = array( # table patch file (in maintenance/archives) array( 'linkscc', 'patch-linkscc.sql' ), @@ -137,4 +141,37 @@ function do_image_name_unique_update() { } } +function do_all_updates() { + global $wgNewTables, $wgNewFields; + + # Add missing tables + foreach ( $wgNewTables as $tableRecord ) { + add_table( $tableRecord[0], $tableRecord[1] ); + flush(); + } + + # Add missing fields + foreach ( $wgNewFields as $fieldRecord ) { + add_table( $fieldRecord[0], $fieldRecord[1], $fieldRecord[2] ); + flush(); + } + + # Do schema updates which require special handling + do_interwiki_update(); flush(); + do_index_update(); flush(); + do_linkscc_1_3_update(); flush(); + convertLinks(); flush(); + do_image_name_unique_update(); flush(); + + if ( isTemplateInitialised() ) { + print "Template namespace already initialised\n"; + } else { + moveCustomMessages( 1 ); flush(); + moveCustomMessages( 2 ); flush(); + moveCustomMessages( 3 ); flush(); + } + + initialiseMessages(); flush(); +} + ?>